// pages/home/home.js
const deviceInfo = wx.getDeviceInfo()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    honModel: '',
    hOSVers: '',
    nickName: '',
    avatarUrl: '',
    city: '',
    province: ''
  },
  search: function(){
    let self = this
    wx.login({
      success: (res) => {
        if(res.code){
          console.log(res.code)
          wx.getUserInfo({
            success: (res1) => {
              console.log(res1)
              this.setData({
                nickName: res1.userInfo.nickName,
                avatarUrl: res1.userInfo.avatarUrl,
                city: res1.userInfo.city,
                province: res1.userInfo.province
              })
            }
          })
        }
      },
    })
    //console.log(deviceInfo.abi)
    console.log(deviceInfo.benchmarkLevel)
    console.log(deviceInfo.brand)
    console.log(deviceInfo.model)
    this.setData({
      honModel:deviceInfo.model,
      hOSVers:deviceInfo.system
    })
    console.log(deviceInfo.platform)
    console.log(deviceInfo.system)
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})